package stock.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/stock")
public class StockContral {

    @Value("${server.port}")
    String port;

    @RequestMapping("/deduct")
    public String deduct() {
        int a = 2 / 0;
        System.out.println("扣减库存");
        return "扣减库存:端口:" + port;
    }

    @GetMapping("/deduct1")
    public String deduct1(){

        System.out.println("扣减库存1");
        return "扣减库存：端口2:"+port;
    }


}
